home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_03
/
v7n3052b.txt
< prev
next >
Wrap
Text File
|
1987-01-01
|
802b
|
23 lines
class ScreenList { // keep a list of ScreenObjs
struct Window {
ScreenObj * head; // a private structure
Window * next; }; // to make a linked list
Window * head; // start of list
Window * current; // so we can step through list
public:
void add(ScreenObj &); // add to the list
void remove(ScreenObj &); // remove a ScreenObj
void reset() { current = head; } // go to beginning
ScreenObj & GetNext();
// return the next one or zero at end
};
main() {
Message M; Reader R; Dialog D;
Screenlist List;
List.add(M); List.add(R); List.add(D);
List.reset();
while( (ScreenObj & Win = List.GetNext()) != 0)
Win.ReDraw(); // ReDraw the whole list
}